<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>${sessionScope.title}</title>
    <meta name="description" content="康利国际营销管理系统 “用互联网+，助力中小企业” 作为公司的经营理念，致力于打造出低成本、高效、高可用的互联网拓客模式。
	公司以诚信、合作、共赢为理念，以客户为中心，以客户的满意为满意。切实有效的为客户提供优质的服务，满足客户需求，实现共同发展。" />
    <meta name="keywords" content="康微客，互联网拓客，郑州互联网拓客，河南互联网公司，郑州软件公司，鼎原，
            鼎原科技，郑州鼎原科技技术有限公司,康利国际营销管理系统,康利国际" />
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/>
    <link href="/admin/css/main.css" rel="stylesheet" type="text/css" />
    <script src="/js/jquery-3.3.1.min.js"></script>
</head>
<body>

<div class="login">
    <div class="box png">
        <%--<div class="logo png"></div>--%>
        <div class="input">
            <div class="log">
                <div class="name">
                    <label>用户名</label><input type="text" class="text" id="username" placeholder="用户名" name="username" tabindex="1">
                </div>
                <div class="pwd">
                    <label>密　码</label><input type="password" class="text" id="password" placeholder="密码" name="password" tabindex="2">
                    <input type="button" id="login" class="submit" tabindex="3" value="登录">
                    <div class="check"></div>
                </div>
                <div class="tip"></div>
            </div>
        </div>
    </div>
    <div class="air-balloon ab-1 png"></div>
    <div class="air-balloon ab-2 png"></div>
    <div class="footer"></div>
</div>

<script type="text/javascript" src="/admin/js/jQuery.js"></script>
<script type="text/javascript" src="/admin/js/fun.base.js"></script>
<script type="text/javascript" src="/admin/js/script.js"></script>
<script src="/admin/js/layer/layer.js"></script>


<!--[if IE 6]>
<script src="js/DD_belatedPNG.js" type="text/javascript"></script>
<script>DD_belatedPNG.fix('.png')</script>
<![endif]-->
<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
    <p>专业的互联网拓客团队，联系电话：0371-55080169</p>
</div>


<script>
    $().ready(function () {
        if (top.location !== self.location) {
            top.location = self.location;
        }
    });
    jQuery(document).ready(function () {
        //回车事件绑定
        document.onkeydown = function (event) {
            var e = event || window.event || arguments.callee.caller.arguments[0];
            if (e && e.keyCode == 13) {
                $('#login').click();
            }
        };
        //登录操作
        $('#login').click(function () {
            var username = '${qianming}'+"/"+$('#username').val();
            //var userCode = $('#username').val();
            //var password = $('#password').val();
            var userCode=$.trim( $('#username').val());
            var password=$.trim($('#password').val());
            if (username == '') {
                $('.error').fadeOut('fast', function () {
                    $('.error').css('top', '27px').show();
                });
                $('.error').fadeIn('fast', function () {
                    $('.username').focus();
                });
                return false;
            }
            if (password == '') {
                $('.error').fadeOut('fast', function () {
                    $('.error').css('top', '96px').show();
                });
                $(this).find('.error').fadeIn('fast', function () {
                    $('.password').focus();
                });
                return false;
            }
            pswd =password,
                data = {password: pswd,userCode:userCode, email: username,qianming:'${qianming}', rememberMe: $("#rememberMe").is(':checked')};
            $.ajax({
                url:'/admin/adminLogin',
                type:'POST', //GET
                async:true,
                data:data,
                timeout:5000,    //超时时间
                dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
                beforeSend:function(xhr){
                    var load = layer.load(2, {time: 1*1000});
                    /*console.log(xhr)
                     console.log('发送前')*/
                },
                success:function(data){
                    if (data.code=="000000"){
                        window.location.href = "/admin/adminIndex?id="+data.data;
                    }else {
                        layer.msg(data.msg, {time: 2000});
                    }
                },
                error:function(xhr,textStatus){
                    console.log('错误')
                    console.log(xhr)
                    console.log(textStatus)
                },
                complete:function(){
                }
            })
        });
    });
</script>
</body>
</html>